home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / jointToolProperties.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  5.1 KB  |  231 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:    Jan. 8, 1997
  22. //  Author:            ap
  23. //
  24. //  Description:    defines behaviour and layout of jointContext
  25. //                    tool property sheet
  26. //
  27.  
  28.  
  29. global proc jointToolPropCallback (string $parent, string $whichCallback)
  30. //
  31. //  Procedure Name:
  32. //      jointToolPropCallback
  33. //
  34. //  Description:
  35. //
  36. //  Input Arguments:
  37. //      parent name, and
  38. //      current callback name.
  39. //
  40. //  Return Value:
  41. //      None.
  42. //
  43. {
  44.     setParent $parent;
  45.  
  46.     string $whichCtx = `currentCtx`;
  47.     string $dofOption;
  48.  
  49.     switch ($whichCallback)
  50.     {
  51.         case "dofOption":
  52.             if (`checkBoxGrp -q -v1 jpDofCheckBoxGrp`) {
  53.                 $dofOption += "x";
  54.             }
  55.             if (`checkBoxGrp -q -v2 jpDofCheckBoxGrp`) {
  56.                 $dofOption += "y";
  57.             }
  58.             if (`checkBoxGrp -q -v3 jpDofCheckBoxGrp`) {
  59.                 $dofOption += "z";
  60.             }
  61.             
  62.             if ("" == $dofOption) {
  63.                 $dofOption = "none";
  64.             }
  65.             jointCtx -e -dJ $dofOption $whichCtx;
  66.             break;
  67.  
  68.         case "autoJointOrientMenu":
  69.             $dofOption = `optionMenuGrp -q -v autoJointOrient`;
  70.             jointCtx -e -ajo $dofOption $whichCtx;
  71.             break;
  72.  
  73.         case "scaleCompensateOn":
  74.             jointCtx -e -scJ true $whichCtx;
  75.             break;
  76.  
  77.         case "scaleCompensateOff":
  78.             jointCtx -e -scJ false $whichCtx;
  79.             break;
  80.  
  81.         case "autoLimitsOn":
  82.             jointCtx -e -jal true $whichCtx;
  83.             break;
  84.  
  85.         case "autoLimitsOff":
  86.             jointCtx -e -jal false $whichCtx;
  87.             break;
  88.  
  89.         case "createIKHandleOn":
  90.             frameLayout -e -en true -cl false ikHandleFrame;
  91.             jointCtx -e -ikh true $whichCtx;
  92.             break;
  93.  
  94.         case "createIKHandleOff":
  95.             frameLayout -e -en false -cl true ikHandleFrame;
  96.             jointCtx -e -ikh false $whichCtx;
  97.             break;
  98.  
  99.         default:
  100.             break;
  101.     }
  102.     return;
  103. }
  104.  
  105.  
  106. global proc jointToolSetCallbacks (string $parent)
  107. //
  108. //    Procedure Name:
  109. //        jointToolSetCallbacks
  110. //
  111. //    Description:
  112. //
  113. //    Input Arguments:
  114. //        parent name.
  115. //
  116. //    Return Value:
  117. //        None.
  118. //
  119. {
  120.     setParent    $parent;
  121.     string        $whichCtx = `currentCtx`;
  122.  
  123.     checkBoxGrp -e
  124.         -cc `CBG "jointToolProp" $parent "dofOption"`
  125.         jpDofCheckBoxGrp;
  126.  
  127.     optionMenuGrp -e
  128.         -cc `CBG "jointToolProp" $parent "autoJointOrientMenu"`
  129.         autoJointOrient;
  130.  
  131.     checkBoxGrp -e
  132.         -onc `CBG "jointToolProp" $parent "scaleCompensateOn"`
  133.         -ofc `CBG "jointToolProp" $parent "scaleCompensateOff"`
  134.         scaleCompensate;
  135.  
  136.     checkBoxGrp -e
  137.         -onc `CBG "jointToolProp" $parent "autoLimitsOn"`
  138.         -ofc `CBG "jointToolProp" $parent "autoLimitsOff"`
  139.         autoLimits;
  140.  
  141.     checkBoxGrp -e
  142.         -onc `CBG "jointToolProp" $parent "createIKHandleOn"`
  143.         -ofc `CBG "jointToolProp" $parent "createIKHandleOff"`
  144.         createIKHandle;
  145.  
  146.     return;
  147. }
  148.  
  149.  
  150. global proc jointToolProperties ()
  151. //
  152. //    Procedure Name:
  153. //        jointToolProperties
  154. //
  155. //    Description:
  156. //
  157. //    Input Arguments:
  158. //        None.
  159. //
  160. //    Return Value:
  161. //        None.
  162. //
  163. {
  164.     setUITemplate -pushTemplate OptionsTemplate;
  165.  
  166.     string    $parent = `toolPropertyWindow -q -location`;
  167.     string    $curctx = `currentCtx`;
  168.  
  169.     setParent    $parent;
  170.  
  171.     columnLayout -adj true jointTool;
  172.         frameLayout -collapsable true -collapse false
  173.             -l "Joint Settings" jointFrame;
  174.             columnLayout jointOptions;
  175.                 separator -style "none";
  176.                 $parent = `setParent -query`;
  177.  
  178.                 checkBoxGrp
  179.                     -label "Degrees of Freedom" 
  180.                     -ncb 3
  181.                     -la3 "X" "Y" "Z"
  182.                     jpDofCheckBoxGrp;
  183.  
  184.                 separator  jSep1;
  185.  
  186.                 optionMenuGrp -l "Auto Joint Orient" autoJointOrient;
  187.                     menuItem -l "none" ajoNone;
  188.                     menuItem -l "xyz" ajoXYZ;
  189.                     menuItem -l "yzx" ajoYZX;
  190.                     menuItem -l "zxy" ajoZXY;
  191.                     menuItem -l "xzy" ajoXZY;
  192.                     menuItem -l "yxz" ajoYXZ;
  193.                     menuItem -l "zyx" ajoZYX;
  194.  
  195.                 separator  jSep2;
  196.  
  197.                 checkBoxGrp
  198.                     -label ""
  199.                     -l1 "Scale Compensate"
  200.                     -ncb 1
  201.                     scaleCompensate;
  202.  
  203.                 checkBoxGrp
  204.                     -label ""
  205.                     -l1 "Auto Joint Limits"
  206.                     -ncb 1
  207.                     autoLimits;
  208.  
  209.                 checkBoxGrp
  210.                     -label ""
  211.                     -l1 "Create IK Handle"
  212.                     -ncb 1
  213.                     createIKHandle;
  214.  
  215.                 jointToolSetCallbacks $parent;
  216.  
  217.             setParent ..; // jointOptions
  218.         setParent ..; // jointFrame
  219.  
  220.         // context options for ikHandle: default is collapsed.
  221.         //
  222.         $parent = `setParent -query`;
  223.         ikHandleOptionLayout( $parent, true );
  224.  
  225.     setParent ..; // joint
  226.  
  227.     setUITemplate -popTemplate;
  228.  
  229.     return;
  230. }
  231.